// 模拟后端动态生成路由
import { MockMethod } from "vite-plugin-mock";

/**
 * roles：页面级别权限，这里模拟二种 "admin"、"common"
 * admin：管理员角色
 * common：普通角色
 */

const routes = [
  {
    menuId: "60fd4c708c3bee9917abd11c",
    name: "系统管理",
    path: "/system",
    sort: 100,
    hidden: false,
    isLeaf: true,
    level: 0,
    parentId: null,
    icon: "ep:tools",
    template: ""
  },
  {
    menuId: "60fd4c988c3bee9917abd174",
    name: "菜单管理",
    path: "/system/menu/index",
    sort: 10,
    hidden: false,
    isLeaf: true,
    level: 1,
    parentId: "60fd4c708c3bee9917abd11c",
    icon: "",
    template: "system/menu/index"
  },
  {
    menuId: "60fd4c988c3bee9917abd177",
    name: "权限管理",
    path: "/system/permission",
    sort: 10,
    hidden: false,
    isLeaf: true,
    level: 1,
    parentId: "60fd4c708c3bee9917abd11c",
    icon: "",
    template: "system/permission/index"
  },
  {
    menuId: "60fd4c988c3bee9917abd179",
    name: "角色管理",
    path: "/system/role",
    sort: 0,
    hidden: false,
    isLeaf: true,
    level: 1,
    parentId: "60fd4c708c3bee9917abd11c",
    icon: "",
    template: "system/role/index"
  },
  {
    menuId: "60fd4c988c3bee9917abd173",
    name: "用户管理",
    path: "/system/operator",
    sort: 0,
    hidden: false,
    isLeaf: true,
    level: 1,
    parentId: "60fd4c708c3bee9917abd11c",
    icon: "",
    template: "system/operator/index"
  },
  {
    menuId: "60fd4c988c3bee9917abd170",
    name: "字典管理",
    path: "/system/dictionary",
    sort: 0,
    hidden: false,
    isLeaf: true,
    level: 1,
    parentId: "60fd4c708c3bee9917abd11c",
    icon: "",
    template: "system/dictionary/index"
  }
];
export default [
  {
    url: "/v1/menu/my",
    method: "post",
    response: () => {
      return {
        code: 0,
        data: routes
      };
    }
  },
  {
    url: "/v1/menu/all",
    method: "get",
    response: () => {
      return {
        code: 0,
        data: routes
      };
    }
  }
] as MockMethod[];
